layui.define(['layer','form','laydate'], function(exports) {
    var $ = layui.jquery;
    var layer=layui.layer;
    var form = layui.form();
    var laydate = layui.laydate;
    var repair_edit = function () {};



    repair_edit.prototype.init=function() {
        $.post("/srv/rdo.php?", {tpl: "getTakesUser", name: "维修人"}, function (d, e) {
            selectShowDataNoH("#repair_user", JSON.parse(d), "id", "username");
            $("#repair_user").prepend("<option value=''>选择维修人</option>");
            //$("#xid").val($("#sid").val());
            form.render('select');
        });
        form.on('submit(formDemo)', function(data){
            //layer.msg(JSON.stringify(data.field));
            //验证通过-提交表单
            $.post("/html/repair/srv/repair_edit.php", $("#form1").serialize(), function (d) {
                layer.msg(d);
                setTimeout("parent.layer.close(parent.layer.getFrameIndex(window.name))", 2000)
            });
        });

        //$('#btn_save').click(function () {
        //    if ($("#type_name").val() == "") {
        //        layer.msg("类型名不能为空");
        //        return false;
        //    }
			//if($("#acceptname").val()==""){layer.msg("请选择维修人");return false;}
        //    $.post("/html/repair/srv/repair_edit.php", $("#form1").serialize(), function (d) {
        //        layer.msg(d);
        //        setTimeout("parent.layer.close(parent.layer.getFrameIndex(window.name))", 2000)
        //    });
        //
        //
        //});
    }
    var repairEdit=new repair_edit();
    repairEdit.init();

    exports('repair_edit',repairEdit);
});